package com.googlecode.pwlodars.piteststat.content;

import java.util.Date;



public class PitestSingleResult {

	private int id;
	private String className;
	private PackageInfo parentPackage;
	private int mutationCoverage;
	private Date runDate;

	public static PitestSingleResult withFuillClassName(String fullClassName, int mutationCoverage){
		return new PitestSingleResult(fullClassName, mutationCoverage);
	}
	
	public static PitestSingleResult withClassNameOnly(String className, int mutationCoverage){
		PitestSingleResult pitestSingleResult = new PitestSingleResult();
		pitestSingleResult.className=className;
		pitestSingleResult.mutationCoverage=mutationCoverage;
		return pitestSingleResult;
	}
	
	private PitestSingleResult() {
		
	}
	
	private  PitestSingleResult(String fullClassName, int mutationCoverage) {
		
		this.parentPackage=PackageInfo.resolveParent(fullClassName);
		this.className = parentPackage.findChildPart(fullClassName);
		this.mutationCoverage=mutationCoverage;
	}
	
	public String getClassName() {
		return className;
	}
	
	public PackageInfo getPackage() {
		return parentPackage;
	}

	public int getMutationCoverage() {
		return mutationCoverage;
	}

	@Override
	public String toString() {
		return "PitestSingleResult [className=" + className + ", packageName=" + parentPackage + ", mutationCoverage="
				+ mutationCoverage + "]";
	}

	public void setRunDate(Date runDate) {
		this.runDate=runDate;
	}

	public Date getRunDate() {
		return runDate;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	
	public int getId() {
		return id;
	}
}
